<% if try(:object_name) %>
  {<%= object_name %>: <%= yield %>}
<% else %>
  <%= yield %>
<% end %>
